package com.dlnu.sujiwords.controller;

import com.dlnu.sujiwords.domain.client.AjaxResult;
import com.dlnu.sujiwords.domain.client.GetReviewParameter;
import com.dlnu.sujiwords.domain.pojo.Review;
import com.dlnu.sujiwords.service.IReviewService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@CrossOrigin
@RequestMapping("/SuJiWords/Review")
public class ReviewController {
    @Resource
    IReviewService service;
    @RequestMapping("/getReviewMsg")
    public AjaxResult getReviewMsg(@RequestBody GetReviewParameter parameter){
        System.out.println(parameter);
        return service.getReviewMsg(parameter.getPhoneNumber(),parameter.getTable());
    }
    @RequestMapping("/getReviewWord")
    public AjaxResult getReview(@RequestBody GetReviewParameter parameter){
        return service.getReviewWord(parameter.getTable(),parameter.getPhoneNumber());
    }
    @RequestMapping("/updateReview")
    public AjaxResult updateReview(@RequestBody Review parameter){
        return service.updateReview(parameter);
    }
}
